#include "httpnet.h"

HttpNet::HttpNet(QObject *parent) : QObject(parent)
{
    /*http=new QNetworkAccessManager(this);
    connect(http,SIGNAL(finished(QNetworkReply*)),this,SLOT(replyfinished(QNetworkReply*)));*///将finished信号与我们定义的槽关联，每当网络应答结束时，都会发射这个信号
}

void HttpNet::post(QString UrlPath,QString Content){
     QNetworkRequest request;
     request.setUrl(QUrl(UrlPath));
     request.setRawHeader("Content-Type","application/x-www-form-urlencoded");
     QByteArray postData;
     postData.append(Content);
     request.setHeader(QNetworkRequest::ContentLengthHeader,postData.size());
     http->post(request,postData);
}


